package com.fivestar.finance.app.injector.module;


import com.fivestar.finance.app.api.CommonApi;
import com.fivestar.finance.app.api.UserApi;

import javax.inject.Singleton;

import dagger.Module;
import dagger.Provides;
import retrofit2.Retrofit;


/**
 * 简要描述
 *
 *  @author Derek.Kidd
 * @version V1.0.0
 * @date 2016/8/16 16:37
 */
@Module
public class ApiModule {

   /**
    * 获取UserApi实例
    *
    * @return
    */
   @Provides
   @Singleton
   public UserApi provideUserApi(Retrofit retrofit) {
       return retrofit.create(UserApi.class);
   }

   /**
    * 获取CommonApi实例
    *
    * @return
    */
   @Provides
   @Singleton
   public CommonApi provideCommonApi(Retrofit retrofit) {
       return retrofit.create(CommonApi.class);
   }
}
